package com.heima.admin.controller;

import com.heima.admin.service.LoginService;
import com.heima.model.admin.dots.LoginADto;
import com.heima.model.common.dtos.ResponseResult;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
@RequiredArgsConstructor
public class LoginController {

    private final LoginService loginService;

    /**
     * 管理平台登录
     * @param dto
     * @return
     */
    @PostMapping("/in")
    public ResponseResult login(@RequestBody LoginADto dto){
        return loginService.login(dto);
    }
}
